<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #div1{
            width: 600px;
            height: 600px;
            background-color: #acf;
            overflow: auto;
        }
        #div2{
            width: 400px;
            height: 1000px;
            background-color: #6af;
        }
    </style>
    <script>
        window.onload = function(){
            var div1 = document.getElementById("div1");
            var div2 = document.getElementById("div2");
            var scrollHeight = document.getElementById("scrollHeight");
            var scrollTop = document.getElementById("scrollTop");
            var clientHeight = document.getElementById("clientHeight");
            scrollHeight.onclick = function(){
                alert(div2.scrollHeight);
            }
            scrollTop.onclick = function(){
                alert(div1.scrollTop);
            }
            clientHeight.onclick = function(){
                alert(div1.clientHeight);
            }
        };
    </script>
</head>
<body>
    <button id="scrollHeight">scrollHeight</button>
    <button id="scrollTop">scrollTop</button>
    <button id="clientHeight">clientHeight</button>
    <br/>
    <div id="div1">
        <div id="div2"></div>
    </div>
    
</body>
</html>